from django.contrib import admin
from models import *

class CaseAdmin(admin.ModelAdmin):
    list_display = ('id','name','user','category')
    list_filter = ('category__name',)
    search_fields = ['id','user','name']
admin.site.register(Case, CaseAdmin)

class FlashInfoAdmin(admin.ModelAdmin):
    list_display = ('title','content','sort')
    search_fields = ['title','content']
admin.site.register(FlashInfo, FlashInfoAdmin)

class QuestionAdmin(admin.ModelAdmin):
    list_display = ('content','content_cn','sort')
admin.site.register(Question,QuestionAdmin)

class AnswerAdmin(admin.ModelAdmin):
    list_display = ('question','content','date')
admin.site.register(Answer,AnswerAdmin)

class CategoryAdmin(admin.ModelAdmin):
    list_display = ('priority','name_cn','name')
admin.site.register(Category,CategoryAdmin)

class OwnershipAdmin(admin.ModelAdmin):
    list_display = ('name_cn','name')
admin.site.register(Ownership,OwnershipAdmin)

class IndustryAdmin(admin.ModelAdmin):
    list_display = ('name_cn','name')
admin.site.register(Industry,IndustryAdmin)

class ProblemTypeAdmin(admin.ModelAdmin):
    list_display = ('name_cn','name')
admin.site.register(ProblemType,ProblemTypeAdmin)

class CompanyScaleAdmin(admin.ModelAdmin):
    list_display = ('name_cn','name')
admin.site.register(CompanyScale,CompanyScaleAdmin)

class DepartmentAdmin(admin.ModelAdmin):
    list_display = ('name_cn','name')
admin.site.register(Department,DepartmentAdmin)

class EmployeeScaleAdmin(admin.ModelAdmin):
    list_display = ('name_cn','name')
admin.site.register(EmployeeScale,EmployeeScaleAdmin)

class FavoriteAdmin(admin.ModelAdmin):
    list_display = ('user','case','date')
admin.site.register(Favorite,FavoriteAdmin)

class BrowseHistoryAdmin(admin.ModelAdmin):
    list_display = ('user','case','date')
admin.site.register(BrowseHistory,BrowseHistoryAdmin)

class UserProfileAdmin(admin.ModelAdmin):
    list_display = ('user','company','industry','scale','position')
admin.site.register(UserProfile,UserProfileAdmin)


